using IQIGame.Onigao.Framework;
using IQIGame.Onigao.Game;

namespace IQIGame.Onigao.GamePlay
{
    public class UD_EquipList : UIBaseData
    {
        public UIEquipListType viewType { get; set; } = UIEquipListType.None;
        public EquipFilter filter { get; set; } = EquipFilter.Default;
        public EquipSort sort { get; set; } = EquipSort.Default;

        public UD_EquipList Sync(UIEquipListType viewType, EquipFilter filter, EquipSort sort)
        {
            this.viewType = viewType;
            this.filter = filter;
            this.sort = sort;
            return this;
        }

        public void Clear()
        {
            this.viewType = UIEquipListType.None;
            this.sort = EquipSort.Default;
            this.filter = EquipFilter.Default;
        }

        public bool IsFilterDefault => this.filter == EquipFilter.Default;

        public void SetDefaultFilter()
        {
            this.filter = EquipFilter.Default;
        }

        #region 对象池

        public override void OnReset()
        {
            this.Clear();
        }

        static public UD_EquipList NewFromPool()
        {
            return ClassPool<UD_EquipList>.Get();
        }
        #endregion

    }
}
